import request from "@/utils/request";

// 添加直播间信息
export function addSteamInfo(data) {
    return request({
      url: '/stream/addStreamInfo',
      method: 'post',
      data: data
    })
}

// 获取所有直播间信息
export function getAllStreamRoom() {
    return request({
        url: '/stream/getAllStreamRoom',
        method: 'get'
    })
}

// 根据用户名获取指定用户直播间
export function getStreamRoomByUsername() {
    return request({
        url: '/stream/getStreamRoomByUsername',
        method: 'get'
    })
}

// 开启或者关闭直播间
export function updateStreamRoomInfo(data) {
    return request({
        url: `/stream/updateStreamRoomInfo`,
        method: 'put',
        data: data
    })
}

// 获取直播间信息
export function updateRoomView(roomId,mode) {
    return request({
        url: `/stream/updateRoomView?roomId=${roomId}&mode=${mode}`,
        method: 'put'
    })
}